/*
 * @Author: youngqj youngqj@126.com
 * @Date: 2024-10-21 20:03:39
 * @LastEditors: youngqj youngqj@126.com
 * @LastEditTime: 2024-12-03 19:53:16
 * @FilePath: /mallSystem/routes/route.go
 * @Description:
 *
 * Copyright © Zhejiang Xiaoqu Information Technology Co., Ltd, All Rights Reserved.
 */
package routes

import (
	"xiaoquio/web/middleware"

	"github.com/gin-gonic/gin"
)

// InitRoutes 初始化所有路由
func InitRoutes() *gin.Engine {
	r := gin.Default()
	r.Use(middleware.SecureHeaders())

	r.Use(middleware.TimingMiddlewareBefore())
	r.Use(middleware.TimingMiddlewareAfter())
	// 注册各模块的路由
	SetupDefaultRoutes(r)
	SetupAuthRoutes(r)
	SetupMemberRoutes(r)

	return r
}
